#include <DefaultFormatter.h>

#include <LogRecord.h>

#include <sstream>

namespace logging
{
    std::string DefaultFormatter::format( const LogRecord & record )
    {
	std::string prefix;

	switch( record.m_logLevel )
	    {
	    case Finest:
	    case Finer:
	    case Fine:
	    case Info:
		prefix = "INFO";
		break;
	    case Config:
		prefix = "CONFIG";
		break;
	    case Warning:
		prefix = "WARNING";
		break;
	    case Severe:
		prefix = "SEVERE";
		break;
	    }

	std::stringstream stream;
	
	stream << "(" << prefix << " " << record.m_timeStamp << "." << record.m_sequenceNumber << ") "
	       << record.m_message;

	return( stream.str() );
    }
}
